package com.fh.lib_base.data.source.impl

import com.fh.lib_base.base.BaseBean
import com.fh.lib_base.data.api.ApiService
import com.fh.lib_base.data.bean.BannerBean
import com.fh.lib_base.data.bean.CityBean
import com.fh.lib_base.data.bean.CitySortBean
import com.fh.lib_base.data.bean.UserBean
import com.fh.lib_base.data.source.HttpDataSource
import io.reactivex.Observable

/**
 * @author Alwyn
 * @Date 2020/7/22
 * @Description
 */
class HttpDataImpl(private val apiService: ApiService) : HttpDataSource {

    override fun userLogin(account: String, pwd: String): Observable<BaseBean<UserBean>> {
        return apiService.pwdLogin(account, pwd)
    }

    override fun getSearchBannerData(): Observable<BaseBean<List<BannerBean>>> {
        return apiService.getSearchBannerData()
    }

    override fun getHotCityListData(): Observable<BaseBean<ArrayList<CityBean>>> {
        return apiService.getHotCityListData()
    }

    override fun getAllCityListData(): Observable<BaseBean<ArrayList<CitySortBean>>> {
        return apiService.getAllCityListData()
    }

    override fun getCitySearchResultListData(keyword: String): Observable<BaseBean<ArrayList<CityBean>>> {
        return apiService.getCitySearchResultListData(keyword)
    }

}